package com.lanqiao.attendance.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lanqiao.attendance.pojo.Teacher;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


/**
 * * @Author Pu Yunsheng
 * * @Data 2022/7/9 下午 05:37
 * * @Version 1.0
 **/
@Data
@NoArgsConstructor
public class TeacherVo {

    private Long id;
    @ApiModelProperty("token")
    private String token;
    @ApiModelProperty("教师编号")
    private String account;
    @ApiModelProperty("密码")
    private String password;
    @ApiModelProperty("教师名字")
    private String name;
    @ApiModelProperty("教师性别")
    private String sex;
    @ApiModelProperty("教师年龄")
    private Integer age;
    @ApiModelProperty("教师年龄")
    private String identify;
    @ApiModelProperty("教师手机号")
    private String phone;
    @ApiModelProperty("教师邮箱")
    private String email;
    @ApiModelProperty("住址")
    private String location;
    @ApiModelProperty("教师等级")
    private String level;
    @ApiModelProperty("教师角色")
    private int role;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
    @ApiModelProperty("注册时间")
    private Date createTime;

    public TeacherVo(String account, String name, String sex, Integer age, String identify, String phone, String email, String location, String level, int role, Date createTime) {
        this.account = account;
        this.password = "密码不可见";
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.identify = identify;
        this.phone = phone;
        this.email = email;
        this.location = location;
        this.level = level;
        this.role = role;
        this.createTime = createTime;
    }

    public TeacherVo(Teacher teacher) {
        this.id = teacher.getId();
        this.account = teacher.getAccount();
        this.password = teacher.getPassword();
        this.name = teacher.getName();
        this.sex = teacher.getSex();
        this.age = teacher.getAge();
        this.identify = teacher.getIdentify();
        this.phone = teacher.getPhone();
        this.email = teacher.getEmail();
        this.location = teacher.getLocation();
        this.level = teacher.getLevel();
        this.role = teacher.getRole();
        this.createTime = teacher.getCreateTime();
    }
}